
// g++ -std=c++11

#include <iostream>

#include <cstdlib>

/* 
atof
	转换字节字符串为浮点值
(函数)
atoi
atol
atoll
	转换字节字符串为整数值
(函数)
strtol
strtoll
	转换字节字符串为整数值
(函数)
strtoul
strtoull
	转换字节字符串为无符号整数值
(函数)
strtof
strtod
strtold
	转换字节字符串为浮点值
(函数)
*/

using namespace std;

int main(int argc, char const *argv[])
{
    std::string n("1234.00");
    cout << n << endl;
    int a;
    long l;
    const char *p = n.c_str();
    char *end;
    l = strtol(p, &end, 10);
    cout << p << ":" << end << endl;
    cout << (end - p ) << endl;
    cout << l << endl;
    // l = stol(n);
    // cout << l << endl;
    // a = atoi(n.c_str());
    // cout << a << endl;
    // a = stoi(n);
    // cout << a << endl;
    return 0;
}
